//
//  FormStackCellModelProtocol.swift
//  CooperSwift_Example
//
//  Created by 计海峰 on 2021/6/3.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import Foundation
import UIKit

// MARK: - 表单默认cell协议
public protocol FormStackCellModelProtocol: FormModelProtocol, TableCellConfigProtocol {
    
    // 默认
    func configBgView(_ bgView: UIView, cell: UITableViewCell)
    func configLeftSpaceView(_ spaceView: UIView, cell: UITableViewCell)
    func configRightSpaceView(_ spaceView: UIView, cell: UITableViewCell)
    
    func configLeftStackView(_ stackView: UIStackView, bgView: UIView)
    func configRightStackView(_ stackView: UIStackView, bgView: UIView)
    func configCenterStackView(_ centerView: UIStackView, bgView: UIView)
    
    
    // MARK: - left stack
    func configLeftView0(_ view: UIView)
    func configLeftViews(_ views: [UIView])
    
    func configLeftLB1(_ lb: UILabel)
    func configLeftLB2(_ lb: UILabel)
    func configLeftLB3(_ lb: UILabel)
    func configLeftLB4(_ lb: UILabel)
    func configLeftLBs(_ lbs: [UILabel])
    
    func configLeftImgV1(_ imageV: UIImageView)
    func configLeftImgV2(_ imageV: UIImageView)
    func configLeftImgV3(_ imageV: UIImageView)
    func configLeftImgV4(_ imageV: UIImageView)
    func configLeftImgs(_ imageVs: [UIImageView])
    
    // MARK: - right stack
    func configRightView0(_ view: UIView)
    func configRightViews(_ views: [UIView])
    
    func configRightLB1(_ lb: UILabel)
    func configRightLB2(_ lb: UILabel)
    func configRightLB3(_ lb: UILabel)
    func configRightLB4(_ lb: UILabel)
    func configRightLBs(_ lbs: [UILabel])
    
    func configRightImgV1(_ imageV: UIImageView)
    func configRightImgV2(_ imageV: UIImageView)
    func configRightImgV3(_ imageV: UIImageView)
    func configRightImgV4(_ imageV: UIImageView)
    func configRightImgs(_ imageVs: [UIImageView])
    
    // MARK: - center stack
    func configCenterLeftViews(_ views: [UIView])
    
    func configCenterLeftLB1(_ lb: UILabel)
    func configCenterLeftLB2(_ lb: UILabel)
    func configCenterLeftLBs(_ lbs: [UILabel])
    
    func configCenterLeftImgV1(_ imageV: UIImageView)
    func configCenterLeftImgV2(_ imageV: UIImageView)
    func configCenterLeftImgs(_ imageVs: [UIImageView])
    
    func configCenterRightViews(_ views: [UIView])
    
    func configCenterRightLB1(_ lb: UILabel)
    func configCenterRightLB2(_ lb: UILabel)
    func configCenterRightLBs(_ lbs: [UILabel])
    
    func configCenterRightImgV1(_ imageV: UIImageView)
    func configCenterRightImgV2(_ imageV: UIImageView)
    func configCenterRightImgs(_ imageVs: [UIImageView])
    
    // 具体
    func configCenterContentTF(_ tf: UITextField)
    func configCenterContentLB(_ lb: UILabel)
    func configCenterContentTV(_ tf: UITextView)
    func configCenterContentBT(_ bt: UIButton)
    
    
    // MARK: - center stack subview
    func configOnceCenterContentTF(_ tf: UITextField)
    func configOnceCenterContentLB(_ lb: UILabel)
    func configOnceCenterContentTV(_ tf: UITextView)
    func configOnceCenterContentBT(_ bt: UIButton)
    
}

// MARK: - 表单默认cell协议 默认实现
public extension FormStackCellModelProtocol {
    
    
    // MARK: - base config
    func configBgView(_ bgView: UIView, cell: UITableViewCell) { }
    func configLeftSpaceView(_ spaceView: UIView, cell: UITableViewCell) { }
    func configRightSpaceView(_ spaceView: UIView, cell: UITableViewCell) { }
    
    func configLeftStackView(_ stackView: UIStackView, bgView: UIView) {
        stackView.subviews.forEach { v in
            v.isHidden = true
        }
    }
    
    func configRightStackView(_ stackView: UIStackView, bgView: UIView) {
        stackView.subviews.forEach { v in
            v.isHidden = true
        }
    }
    
    func configCenterStackView(_ centerView: UIStackView, bgView: UIView) {
        centerView.subviews.forEach { v in
            v.isHidden = true
        }
    }
    
    // MARK: - left stack
    func configLeftView0(_ view: UIView) { }
    
    func configLeftLB1(_ lb: UILabel) { }
    func configLeftLB2(_ lb: UILabel) { }
    func configLeftLB3(_ lb: UILabel) { }
    func configLeftLB4(_ lb: UILabel) { }
    
    func configLeftImgV1(_ imageV: UIImageView) { }
    func configLeftImgV2(_ imageV: UIImageView) { }
    func configLeftImgV3(_ imageV: UIImageView) { }
    func configLeftImgV4(_ imageV: UIImageView) { }
    
    func configLeftViews(_ views: [UIView]) { }
    func configLeftLBs(_ lbs: [UILabel]) { }
    func configLeftImgs(_ imageVs: [UIImageView]) { }
    
    // MARK: - right stack
    func configRightView0(_ view: UIView) { }
    
    func configRightLB1(_ lb: UILabel) { }
    func configRightLB2(_ lb: UILabel) { }
    func configRightLB3(_ lb: UILabel) { }
    func configRightLB4(_ lb: UILabel) { }
    
    func configRightImgV1(_ imageV: UIImageView) { }
    func configRightImgV2(_ imageV: UIImageView) { }
    func configRightImgV3(_ imageV: UIImageView) { }
    func configRightImgV4(_ imageV: UIImageView) { }
    
    func configRightViews(_ views: [UIView]) { }
    func configRightLBs(_ lbs: [UILabel]) { }
    func configRightImgs(_ imageVs: [UIImageView]) { }
    
    // MARK: - center stack
    func configCenterLeftLB1(_ lb: UILabel) { }
    func configCenterLeftLB2(_ lb: UILabel) { }
    
    func configCenterLeftImgV1(_ imageV: UIImageView) { }
    func configCenterLeftImgV2(_ imageV: UIImageView) { }
    
    func configCenterLeftLBs(_ lbs: [UILabel]) { }
    func configCenterLeftImgs(_ imageVs: [UIImageView]) { }
    
    func configCenterLeftViews(_ views: [UIView]) { }
    
    func configCenterRightLB1(_ lb: UILabel) { }
    func configCenterRightLB2(_ lb: UILabel) { }
    func configCenterRightImgV1(_ imageV: UIImageView) { }
    func configCenterRightImgV2(_ imageV: UIImageView) { }
    
    func configCenterRightLBs(_ lbs: [UILabel]) {  }
    func configCenterRightImgs(_ imageVs: [UIImageView]) { }
    
    func configCenterRightViews(_ views: [UIView]) { }
    
    // MARK: - center stack once
    func configCenterContentTF(_ tf: UITextField) { }
    func configCenterContentLB(_ lb: UILabel) { }
    func configCenterContentTV(_ tf: UITextView) { }
    func configCenterContentBT(_ bt: UIButton) { }
    
    // MARK: - center stack once
    func configOnceCenterContentTF(_ tf: UITextField) { }
    func configOnceCenterContentLB(_ lb: UILabel) { }
    func configOnceCenterContentTV(_ tf: UITextView) { }
    func configOnceCenterContentBT(_ bt: UIButton) { }
    
}
